-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: invalid date_time #2279
fix: invalid date_time #2279
Conversation
Code Climate has analyzed commit 6b59894 and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add some tests and a scenario where one can try this?
Done, the bug was happening when a |
Could you please add a regular |
You're right, the issue is the same, that tab is eager loading, since is not an association I'm not sure if it's viable to lazy load it. I'm checking the JS maybe we can avoid breaking from there |
The initial value on JS has some white spaces around it when the field was rendering hidden. We trim that value now |
app/components/avo/fields/has_one_field/show_component.html.erb
Outdated
Show resolved
Hide resolved
module FrameLoading | ||
extend ActiveSupport::Concern | ||
|
||
def turbo_frame_loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this change will impact any other components @Paul-Bob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also apply this change on app/components/avo/fields/has_many_field/show_component.html.erb
…w_component.html.erb`
…x/invalid_date_time
This PR has been merged into Please check the release guide for more information. |
Description
Fields of type
has_one
was eager loading on tabs.This was causing the
date_time
field's related JS to broke when the field panel was loading on a hidden tab, resulting on the stringInvalid DateTime
.More specifically the
this.initialValue
on the date field stimulus controller was getting some weird spaces around the value when the field was rendering hidden, we also trim that value now.Fixes #2261
Checklist:
Screenshots
Manual review steps
Manual reviewer: please leave a comment with output from the test if that's the case.